<template>
  <div class="process">
    <div
      v-for="(item, index) in processList"
      :key="index"
      class="processContainer"
    >
      <div class="processList" >
       <img :src="item.imgSrc"  class="iconfont"/>
        <div class="active" v-if="isActive" @click="goLink(item)">
          {{ item.name }}
        </div>
        <div class="processName" @click="goLink(item)" v-else>
          {{ item.name }}
        </div>
      </div>
      <img class="arrow" src="@/assets/single/arrow.png"  v-if="processList.length - index !== 1 && navTitle === '立项评审'"/>
      <div class="arrow" v-if="processList.length - index !== 1 && navTitle !== '立项评审'"> | </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "process",
  props: {
    processList: {
      type: Array,
      default: () => []
    },
    isActive: {
      type: Boolean,
      default: false
    },
    navTitle: {
      type: String,
      default: ""
    }
  },
  methods: {
    goLink(item){
      if(item.url){
        this.$router.push({
          path: item.url
        })
      }
    }
  }
};
</script>
<style lang="less" scoped>
.process {
  display: flex;
  justify-content: flex-start;
  max-width: 500px;
  overflow: auto;
  .processContainer {
    display: flex;
    justify-content: flex-start;
  }
  .processList {
    width: 80px;
    display: flex;
    justify-content: flex-start;
    .iconfont {
      width: 16px;
      height: 16px;
      margin-top: 5px;
      margin-right: 2px;
    }
    .processName {
      font-size: 14px;
      color: #333;
      cursor: pointer;
    }
    .active{
      font-size: 14px;
      color: #999;
      cursor: pointer;
  }
  }
  .arrow {
    width: 18px;
    height: 12px;
    margin: 10px 10px;
  }
}
</style>